package com.study.edoc.common;

import lombok.Data;

import java.io.Serializable;
import java.util.List;


public class Pageable<T> implements Serializable {

    private int total;
    private int pages;
    private int curr;
    private int size;
    private List<T> data;


    public Pageable(int curr,int size,int total,List<T> data){
        this.setCurr(curr);
        this.setSize(size);
        this.setTotal(total);
        this.setData(data);
        this.pages = (int)Math.ceil(total*1.0/size);
    }


    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public int getPages() {
        return pages;
    }

    public int getCurr() {
        return curr;
    }

    public void setCurr(int curr) {
        this.curr = curr;
    }

    public int getSize() {
        return size;
    }

    public void setSize(int size) {
        this.size = size;
    }

    public List<T> getData() {
        return data;
    }

    public void setData(List<T> data) {
        this.data = data;
    }
}
